//
// Created by zhupi on 2024/9/5.
//

#include "gallery_view.h"
#include "gallery/base_cell/gallery_base_cell_widget.h"
#include <QPushButton>

GalleryView::GalleryView(QWidget *parent) {

}

void GalleryView::Initial() {
    InitWidget();
}

void GalleryView::InitWidget() {
    QVBoxLayout *vbox = new QVBoxLayout;
    vbox->setContentsMargins(0, 0, 0, 0);

    GalleryBaseCellWidget * widget = new GalleryBaseCellWidget(this);
    QAction *actio  =new QAction;
    actio->setIcon(QIcon("C:/Users/zhupi/OneDrive/桌面/work/2.jpg"));

    QAction *actio1  =new QAction;
    actio1->setIcon(QIcon("C:/Users/zhupi/OneDrive/桌面/work/2.jpg"));

    QAction *actio2  =new QAction;
    actio2->setIcon(QIcon("C:/Users/zhupi/OneDrive/桌面/work/2.jpg"));

    widget->AddLargeAction(actio);
    widget->AddLargeAction(new QAction);
    widget->AddLargeAction(new QAction);

    widget->AddMediumAction(actio1);


    vbox->addWidget(widget);
    vbox->addStretch();

//    QGridLayout *layout = new QGridLayout;
//
//    // 创建按钮
//    QPushButton *newButton = new QPushButton("新建\n幻灯片");
//    QPushButton *formatButton = new QPushButton("格式");
//    QPushButton *resetButton = new QPushButton("重置");
//    QPushButton *slideButton = new QPushButton("幻灯片");
//    QPushButton *sectionButton = new QPushButton("节");
//
//    // 设置按钮的大小策略
//    newButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
//    formatButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
//    resetButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
//    slideButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
//    sectionButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
//
//    // 将按钮添加到布局中
//    layout->addWidget(newButton, 0, 0, 3, 1);  // 跨两行一列
//    layout->addWidget(formatButton, 0, 1);
//    layout->addWidget(resetButton, 1, 1);
////    layout->addWidget(slideButton, 2, 0);
//    layout->addWidget(sectionButton, 2, 1);

    this->setLayout(vbox);
}
